package com.blx.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.blx.entity.Message;
import com.blx.service.MessageService;
import com.blx.utils.pagination.Pagination;

/**
 * ClassName:  MessageController. <br/>
 * Description:  MessageController 页面处理类 <br/>
 * @author wangwl
 * 2013-3-4 下午10:04:16 <br/>
 * @version 1.0
 */
@Controller
@RequestMapping("/message")
public class MessageController {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private MessageService messageService;

	/**
	 * Message列表
	 */
	@RequestMapping(value="list")
	public String list(Model model,Integer page){
		logger.debug("method[list],params[page:{}]",page);
		Pagination<Message> pagination = messageService.findPageMessageAll(1, 2);
		model.addAttribute("managerList", pagination);
		return "message/list";
	}
	/**
	 * Message保存
	 */
	@RequestMapping(value="save")
	public String save(Model model){
		//TODO 保存service
		return "message/list";
	}
	/**
	 * Message更新
	 */
	@RequestMapping(value="update")
	public String update(Model model,Integer page){
		//TODO 更新service
		return "message/list";
	}
	/**
	 * Message删除
	 */
	@RequestMapping(value="delete")
	public String delete(Model model,Integer messageId){
		//TODO 删除service
		return "message/list";
	}
}

